package priv.yiyuan.example.design.proxy;

/**
 * 信用卡支付
 * <p>
 * 策略模式-具体策略
 *
 * @author YiYuan
 * @data 2025/9/25
 * @apoNote
 */
public class CreditCardPaymentStrategy implements PaymentStrategy {

    private String cardNumber;

    private String expiryDate;

    public CreditCardPaymentStrategy(String cardNumber, String expiryDate) {
        this.cardNumber = cardNumber;
        this.expiryDate = expiryDate;
    }

    @Override
    public void pay(double amount) {

        System.out.println("[信用卡支付策略] 正在使用信用卡 " + cardNumber + " (有效期: " + expiryDate + ") 支付" + amount + " 元。");
        System.out.println("[信用卡支付策略] 支付成功。");

    }

}
